package com.mxpio.erp.common.quality.entity;

import com.mxpioframework.jpa.annotation.DictAble;
import com.mxpioframework.jpa.annotation.Generator;
import com.mxpioframework.security.annotation.Dict;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.persistence.*;
import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;

@Data
@EqualsAndHashCode(callSuper=false)
@Entity
@Table(name = "V_MB_ERP_INSPECTION_BILL_PROCESS_MATERIAL_SCRAP")
@Schema(description="零件报废视图")
public class VEInspectionBillProcessMaterialScrap implements DictAble, Serializable {

    private static final long serialVersionUID = 1L;

    @Id
    @Generator
    @Column(name = "ID_", updatable = false)
    @Schema(description = "ID")
    private String id;


//    @Id
    @Schema(description = "申请时间（年）")
    @Column(name = "YEAR_")
    private String year;

    @Schema(description = "班组")
    @Column(name = "WORK_TEAM_" )
    @Dict(dicCode = "ERP_QUAL_TEMP_WORK_TEAM")
    private String workTeam;

//    @Dict(dicCode = "MB_ERP_QUALITY_PROCESS_MATERIAL_SCRAP_END_PHASE")
//    @Schema(description = "报废阶段")
//    @Column(name = "END_PHASE_")
//    private String endPhase; //10 工序检验 20 成品检验

    @Schema(description = "工序检验数量")
    @Column(name = "PROCESS_NUM_" )
    private String processNum;

    @Schema(description = "成品检验数量")
    @Column(name = "FG_NUM_" )
    private String fgNum;

    @Transient
    private Map<String, String> textMap;
    public String putText(String key, String value) {
        if (textMap == null) {
            textMap = new HashMap<>();
        }
        return textMap.put(key, value);
    }
}
